from datetime import datetime




# class BaseModel(object):
#     """模型基类，为每个模型补充创建时间与更新时间"""
#     create_time = db.Column(db.DateTime, default=datetime.now)  # 记录的创建时间
#     update_time = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now)  # 记录的更新时间
from manage import db


class User(db.Model):
    __tablename__ = "user_info"
    id = db.Column(db.Integer, primary_key=True)  # 用户编号
    user_name = db.Column(db.String(32), unique=True, nullable=False)  # 用户名/队名
    score = db.Column(db.Integer)  # 总得分


class Exam(db.Model):
    __tablename__= "exam_info"
    id = db.Column(db.Integer, primary_key=True)  # 题目编号
    questions = db.Column(db.String(512), nullable=False)  # 题目内容
    answers = db.Column(db.String(4), nullable=True)  # 答案
    options = db.Column(db.String(256), nullable=False)  # 选项